import {BasicPageParams, BasicFetchResult} from '/@/api/model/baseModel';

export type LogListParams = BasicPageParams & {
    user_id: number;
    object_cls: string;
    method: string;
    ip: string;
    remark: string
    detail: string
}

export type AccountParams = BasicPageParams & {
    account?: string;
    nickname?: string;
};
export type RoleParams = {
    roleName?: string;
    status?: string;
};

export type AccountCreateData = {
    username: string
    password: string
    email?: string
    nickname?: string
    remarks?: string
    roles?: number[]
}
export type AccountUpdate = {
    username: string
    email?: string
    nickname?: string
    remarks?: string
    roles?: number[]
}
export type MenuParams = {
    menuName?: string;
    status?: string;
};

export type RolePageParams = BasicPageParams & RoleParams;

export interface AccountListItem {
    id: number;
    username: string;
    email: string;
    nickname: string;
    role: RoleListItem[];
    // createTime: string;
    createTimeStart: string;
    createTimeEnd: string;
    remark: string;
    status: number;
}

export interface RoleListItem {
    id: number;
    roleName: string;
    roleValue: string;
    status: boolean;
    orderNo: string;
    createTime: string;
}

export interface MenuListItem {
    id: string;
    orderNo: number;
    createTime: string;
    status: boolean;
    icon: string;
    component: string;
    permission: string;
}

/**
 * @description: Request list return value
 */
export type AccountListGetResultModel = BasicFetchResult<AccountListItem>;

export type RoleListGetResultModel = RoleListItem[];

export type RolePageListGetResultModel = BasicFetchResult<RoleListItem>;

export type MenuListGetResultModel = BasicFetchResult<MenuListItem>;
